optimization = -O3
objects = TreeState.o Alignment.o PopTree.o CmdLine.o ManyTrees.o gzstream.o Tree.o PopGraph.o PhyloPop_params.o 

libs = -L/opt/local/lib -lgsl -lgslcblas -lm -lz
inc = -I/opt/local/include

build_tree: build_tree.o $(objects)
	g++ $(libs) -o build_tree build_tree.o $(objects) $(optimization)
genetrees: GeneTrees.o $(objects)
	g++ $(libs) -o genetrees GeneTrees.o $(objects) $(optimization)

test: test.o $(objects)
	g++ $(libs) -o test test.o $(objects) $(optimization)

%.o: %.cpp
	g++ -c $< -o $@ $(inc) $(optimization)

clean:
	rm *.o
